Dynomotion

Group: DynoMotion Message: 7806 From: daveymahomh600e Date: 6/28/2013
Subject: fscanf issue
Hello Tom,

I have been trying to use the fscanf function in a c program but the system doesn't seem to know what it is. Is the stdio.h included in the files somewhere? fprintf seems okay, but not the scanner.

Thanks,
David.
Group: DynoMotion Message: 7808 From: Tom Kerekes Date: 6/28/2013
Subject: Re: fscanf issue
Hi David,

No sorry fscanf is not supported.  Only fprintf in a limited manner.  Please realize KFLOP is a DSP on the end of a USB connection not a PC with Disk OS and such.

What is it you need to do?

Regards
TK


Group: DynoMotion Message: 7809 From: David Stevenson Date: 6/28/2013
Subject: Re: fscanf issue

Hi Tom,
 
I want to read in three lines of data from a .txt file, such as...
 
2.5
.125
.035
 
and assign them to a variable within a C program.
 
Thank you,
David.
 
 
-----Original Message-----
From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com]On Behalf Of Tom Kerekes
Sent: Friday, June 28, 2013 7:38 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] fscanf issue

 

Hi David,

No sorry fscanf is not supported.  Only fprintf in a limited manner.  Please realize KFLOP is a DSP on the end of a USB connection not a PC with Disk OS and such.

What is it you need to do?

Regards
TK


Group: DynoMotion Message: 7811 From: Tom Kerekes Date: 6/28/2013
Subject: Re: fscanf issue
Hi David,

Well that description doesn't give us many alternatives other than reading a file.  What is the bigger picture.  Where do the values come from?  Could a PC Program put the Values into KFLOP with Script commands?  Could the values be included in the C program as constants before it is executed?

Regards
TK


Group: DynoMotion Message: 7813 From: David Stevenson Date: 6/29/2013
Subject: Re: fscanf issue

Hi Tom,
 
The values come from a small windows app that I created so a person could input the 3 values which are details for a probing routine. The probing routine is a c program, so if they could be input directly as part of that program, that would certainly work. As you probably know, I'm not a programmer and any help would be appreciated. You have no idea how many hours I burned just to get the Windows app to fly and I'm ashamed to tell you.
 
Thank you,
David.
 
-----Original Message-----
From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com]On Behalf Of Tom Kerekes
Sent: Friday, June 28, 2013 8:52 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] fscanf issue

 

Hi David,

Well that description doesn't give us many alternatives other than reading a file.  What is the bigger picture.  Where do the values come from?  Could a PC Program put the Values into KFLOP with Script commands?  Could the values be included in the C program as constants before it is executed?

Regards
TK


Group: DynoMotion Message: 7815 From: Tom Kerekes Date: 6/29/2013
Subject: Re: fscanf issue
Hi David,

So how about this:

Write the values to a disk file on the PC in this format:

double a=123.4;
double b=567.8;
double c=0.999;

Then include the file into the KFLOP Probe Program with something like:

#include "C:\Temp\Data.c"


Regards
TK

Group: DynoMotion Message: 7817 From: David Stevenson Date: 6/29/2013
Subject: Re: fscanf issue

Hi Tom,
 
Interesting.  So, do you mean write the Windows data out in this format?
 
I'll give it a try.
 
Thanks very much,
David.
 
-----Original Message-----
From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com]On Behalf Of Tom Kerekes
Sent: Saturday, June 29, 2013 9:36 AM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] fscanf issue

 

Hi David,

So how about this:

Write the values to a disk file on the PC in this format:

double a=123.4;
double b=567.8;
double c=0.999;

Then include the file into the KFLOP Probe Program with something like:

#include "C:\Temp\Data.c"


Regards
TK

Group: DynoMotion Message: 7819 From: daveymahomh600e Date: 6/29/2013
Subject: Re: fscanf issue
Hello Tom,

That certainly did do the trick. Thank you!

David

--- In DynoMotion@yahoogroups.com, "David Stevenson" <david.m.stevenson@...> wrote:
>
> Hi Tom,
>
> Interesting. So, do you mean write the Windows data out in this format?
>
> I'll give it a try.
>
> Thanks very much,
> David.
>
>
Group: DynoMotion Message: 7962 From: ericncn Date: 7/19/2013
Subject: Re: fscanf issue
I am not sure I understood correctly, but that could be very useful to me.

Do you mean that I could execute a fprintf() on the KFLOP and it would write a file on the PC file system?

Is KFLOP stdio tricked in some way, so it uses I/O on the PC ?

Could I also execute a system(); call in the KFLOP and have a .exe or a .bat executed on the PC system?

If yes, I probably could do all I need from within KFLOP with no need to tinker with the KmotionCNC interface...

EC

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi David,
>
> No sorry fscanf is not supported.  Only fprintf in a limited manner.  Please realize KFLOP is a DSP on the end of a USB connection not a PC with Disk OS and such.
>
> What is it you need to do?
>
> Regards
> TK
>
>
>
>
>
> ________________________________
> From: daveymahomh600e <david.m.stevenson@...>
> To: DynoMotion@yahoogroups.com
> Sent: Friday, June 28, 2013 3:52 PM
> Subject: [DynoMotion] fscanf issue
>
>
>
>  
> Hello Tom,
>
> I have been trying to use the fscanf function in a c program but the system doesn't seem to know what it is. Is the stdio.h included in the files somewhere? fprintf seems okay, but not the scanner.
>
> Thanks,
> David.
>